package com.course.domain.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

/**
 * <p>
 * 课程评论表（支持无限级嵌套回复）
 * </p>
 *
 * @author 小杰大人
 * @since 2025-04-15
 */
@Getter
@Setter
@TableName("course_comment")
@ApiModel(value = "CourseComment对象", description = "课程评论表（支持无限级嵌套回复）")
@ToString
public class CourseComment implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty("主键，自增")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty("评论内容（支持富文本）")
    @TableField("content")
    private String content;

    @ApiModelProperty("评论者ID（关联用户表）")
    @TableField("user_id")
    private Long userId;

    @ApiModelProperty("所属课程ID（关联课程表）")
    @TableField("course_id")
    private Long courseId;

    @ApiModelProperty("父评论ID（null表示一级评论，非null时为被回复的评论ID）")
    @TableField("parent_id")
    private Long parentId;

    @ApiModelProperty("根评论ID（一级评论为自身id，二级以上指向所属一级评论）")
    @TableField("root_id")
    private Long rootId;

    @ApiModelProperty("被回复用户ID（用于@用户显示）")
    @TableField("target_user_id")
    private Long targetUserId;

    @ApiModelProperty("点赞数（原子操作保证一致性）")
    @TableField("like_count")
    private Integer likeCount;

    @ApiModelProperty("创建时间（排序依据）")
    @TableField("create_time")
    private LocalDateTime createTime;

}
